import React from 'react'
// useSelector 用来获取仓库状态 useDispatch 用来获取dispatch 提交改变状态
import {useSelector,useDispatch} from 'react-redux';
export default function About() {
    // hooks 返回你要获取的状态 state仓库中所有状态
  let num = useSelector((state)=>{
    return state.num
  })
  let dispatch = useDispatch();
  return (
    <div>
            <div>About ---{num}</div>
            <button onClick={()=>{
                dispatch({
                    type:"ADD",
                    num:10
                })
            }}>+10</button>
    </div>
  )
}
